package com.escape.wx.handler;

import lombok.Getter;

@Getter
public enum WxChatMsgTypeEnum {

    SUBSCRIBE("event.subscribe","用户订阅"),
    TEXT_MSG("text","接收用户文本消息");

    private String msgType;
    private String desc;

    WxChatMsgTypeEnum(String msgType,String desc){
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WxChatMsgTypeEnum getEnum(String msgType){
        for (WxChatMsgTypeEnum e: WxChatMsgTypeEnum.values()){
            if (msgType.equals(e.msgType)) {
                return e;
            }
        }
        return null;
    }

}
